<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('操作原因')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-user-resetPwd">
			<input name="ids" id="ids" type="hidden" th:value="${ids}" />
			<input name="state" id="state" type="hidden" th:value="${state}" />
			<div class="form-group">
				<div class="col-sm-12">
					<input type="text" id="operateReason" th:placeholder="(*{state}=='3'? '上线名称':(*{state}=='4'?'下线理由':'不可上线原因')) "
						   class="form-control" maxlength="50" rows="5" name="operateReason" required>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">

		function submitHandler() {
		    var data;
            var url;
//            if ($("#ids").val().indexOf(",") == -1){
//                data = { "ids":  $("#ids").val(), "state": -1, "operateReason": $("#operateReason").val()};
//                url = ctx + "media/media/audit";
//            }else {
//                data = { "ids":  $("#ids").val(), "state": -1, "operateReason": $("#operateReason").val()};
//                url = ctx + "media/media/auditAll";
//            }
			var operateReason = $("#operateReason").val();
			var state = $("#state").val();
			if ($.common.isEmpty(operateReason)){
				if (state == '3'){
					$.modal.alertError("请填写上线名称")
				}else if (state == '4'){
					$.modal.alertError("请填写下线理由")
				}else{
					$.modal.alertError("请填写不可上线原因")
				}
				return;
			}
			data = { "ids":  $("#ids").val(), "state": state, "operateReason": operateReason};
			url = ctx + "media/itemAlbum/edit";
            $.operate.save(url, data);
	    }
	</script>
</body>

</html>
